package cn.edu.lzu.unitweb.controller;

import cn.edu.lzu.entity.Nation;
import cn.edu.lzu.service.NationService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @PackageName: cn.edu.lzu.unitweb.controller
 * @ClassName: NationController
 * @Description: TODO
 * @Author: 张琦[QQ:3098086691]
 * @Date: 2020/4/18 16:27
 * @Version: 1.0
 */
@Controller
public class NationController {
    @Resource
    private NationService nationService;

    @ResponseBody
    @RequestMapping("/getNations")
    public List<Nation> getNations(){
        List<Nation> nationList=nationService.getAllNations();
        System.out.println("nationList = " + nationList);
        return nationList;
    }

}
